﻿namespace WatiNSahi.Extensions
{
    using global::WatiN.Core;

    public static class LinkCollectionExtensions
    {
        public static bool Exists(this LinkCollection linkCollection, string linkIdOrNameOrValueorClass, bool extension = true)
        {
            return linkCollection.Exists(Find.ById(linkIdOrNameOrValueorClass)) ||
                linkCollection.Exists(Find.ByName(linkIdOrNameOrValueorClass)) ||
                linkCollection.Exists(Find.ByValue(linkIdOrNameOrValueorClass)) ||
                linkCollection.Exists(Find.ByClass(linkIdOrNameOrValueorClass)) ||
                linkCollection.Exists(Find.ByLabelText(linkIdOrNameOrValueorClass));
        }
    }
}